//
//  HWPayFangshiViewCell.m
//  HWanGame
//
//  Created by 陈道斌 on 2019/9/19.
//  Copyright © 2019 Chendaobin. All rights reserved.
//

#import "HWPayFangshiViewCell.h"
@interface HWPayFangshiViewCell()
@property(strong,nonatomic)UIImageView *icimageView;
@property(strong,nonatomic) UILabel *miashuLabel;
//@property(strong,nonatomic) UIButton *selecbutton; // 选中Button;



@end

@implementation HWPayFangshiViewCell



- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self setupUI];
        
    }
    
    return  self;
    
}

//设置UI

- (void)setupUI {
    
    UIImageView *imageview1 = [[UIImageView alloc]initWithFrame:CGRectMake(15, 12, 25, 25)];
    imageview1.image = [UIImage imageNamed:@"icon_pt"];
    self.icimageView = imageview1;
    [self.contentView addSubview:imageview1];
    
    self.miashuLabel  = [[UILabel alloc]initWithFrame:CGRectMake(imageview1.right+12, 0, 180, 50)];
    self.miashuLabel.text = @"平台币支付";
    self.miashuLabel.font = [UIFont systemFontOfSize:12];
    self.miashuLabel.textColor = RGB(51, 51, 51);
    [self.contentView addSubview:self.miashuLabel];
    
    
    self.selecbutton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.selecbutton.frame = CGRectMake(kScreenW-20-14, 15, 20, 20);
    
    [self.selecbutton setBackgroundImage:[UIImage imageNamed:@"dela_icon_cir"] forState:UIControlStateNormal];
    
    [self.contentView addSubview:self.selecbutton];
    
    
    UIView *xianview = [[UIView alloc]initWithFrame:CGRectMake(0, 49, kScreenW, 1)];
    xianview.backgroundColor = RGB(232, 232, 242);
    [self.contentView addSubview:xianview];
    
    
}


-(void)setModel:(HWBuyAccountModel *)model {
    
    _model = model;
    self.icimageView.image = [UIImage imageNamed:model.icoStr];
    self.miashuLabel.text = model.nameStr;
    
    
    if (model.seleico) {
        
        [self.selecbutton setBackgroundImage:[UIImage imageNamed:@"checkbox-on"] forState:UIControlStateNormal];
        
        
    } else {
        
        [self.selecbutton setBackgroundImage:[UIImage imageNamed:@"dela_icon_cir"] forState:UIControlStateNormal];
        
    }
   
    
    
}



@end
